

/*
 * @FilePath: user.js
 * @Author: luo
 * @Date: 2022-11-17 16:43:53
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-21 20:54:54
 * Copyright: 2022 xxxTech CO.,LTD. All Rights Reserved.
 * @Descripttion: 
 */
import request from '@/utils/request'
export default {
  //获取登录短信
  getMsg(){
    return request({
      url: '/user/getLoginMsg',
      method: 'post',
     })
  },
  // 注册用户
   registerUser(user) {
    return request({
      url: '/user/register',
      method: 'post',
      data: user
     })
  },
  // 登录
   loginUser(loginBean) {
    return request({
      url: '/user/login',
      method: 'post',
      data:loginBean
    })
  },
  //短信登录
  loginbymsg(user) {
    return request({
      url: '/user/loginUserByMsg',
      method: 'post',
      data:user
    })
  },
  //根据ID查询
   queryUserById(id){
    return request({
        url: '/user/queryUserById',
        method: 'post',
        data:id
      })
    },
//头条号 
    //更新用户信息
    updateUser(user) {
        return request({
            url: '/user/updateUserById',
            method: 'post',
            headers: { 'Content-Type': 'multipart/form-data' },
            data:user
        })
    },
    //通过用户id查看用户信息是否完善 完善条件：查找出用户内容 检查是否有昵称
    //如果不完善，携带用户信息跳转头条号页面 
    //获取用户信息 包括个人中心页面 
    getUser(id) {
         return request({
            url: '/user/queryUserById?id='+id,
            method: 'get'
            
        })
    },

  allWork(id) {
      return request({
            url: '/user/queryAllWorkByUserId?userId='+id,
            method: 'get'
            
        })
  },
  
  // 搜索个人作品
  searchByWorkByUserId(word, userId){
    return request({
            url: '/user/searchAllWorkByWord?userId='+userId+"&word="+word,
            method: 'get'
            
        })
  }


}
